package vista;
import java.awt.BorderLayout;
import java.awt.Desktop.Action;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class Ingredientev extends javax.swing.JFrame implements AbstractFactory{
	private JPanel Panelingrediente;
	private JTextField txtcoding;
	private JButton btncancelar;
	private JSeparator jSeparator2;
	private JSeparator jSeparator1;
	private JButton btnregistrar;
	private JTextField txtstock;
	private JTextField txtcantidad;
	private JTextField txtingrediente;
	private JLabel lbling;
	private JLabel lblstock;
	private JLabel lblcantidad;
	private JLabel lblcoding;
	private JLabel lblingrediente;

	/**
	* Auto-generated main method to display this JFrame
	*/
	
	public Ingredientev() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("Registrar Ingrediente");
			getContentPane().setLayout(null);
			{
				Panelingrediente = new JPanel();
				getContentPane().add(Panelingrediente, "Center");
				Panelingrediente.setBounds(0, 0, 461, 286);
				Panelingrediente.setLayout(null);
				{
					lblingrediente = new JLabel();
					Panelingrediente.add(lblingrediente);
					lblingrediente.setText("Ingrediente:");
					lblingrediente.setBounds(54, 70, 97, 17);
					lblingrediente.setFont(new java.awt.Font("Bookman Uralic",2,14));
				}
				{
					lblcoding = new JLabel();
					Panelingrediente.add(lblcoding);
					lblcoding.setText("Codigo del ingrediente:");
					lblcoding.setBounds(56, 107, 168, 17);
					lblcoding.setFont(new java.awt.Font("Bookman Uralic",2,14));
				}
				{
					lblcantidad = new JLabel();
					Panelingrediente.add(lblcantidad);
					lblcantidad.setText("Cantidad:");
					lblcantidad.setBounds(54, 148, 68, 17);
					lblcantidad.setFont(new java.awt.Font("Bookman Uralic",2,14));
				}
				{
					lblstock = new JLabel();
					Panelingrediente.add(lblstock);
					lblstock.setText("Stock:");
					lblstock.setBounds(248, 148, 53, 17);
					lblstock.setFont(new java.awt.Font("Bookman Uralic",2,14));
				}
				{
					txtingrediente = new JTextField();
					Panelingrediente.add(txtingrediente);
					txtingrediente.setBounds(163, 68, 140, 22);
				}
				{
					txtcoding = new JTextField();
					Panelingrediente.add(txtcoding);
					txtcoding.setBounds(229, 105, 66, 22);
				}
				{
					txtcantidad = new JTextField();
					Panelingrediente.add(txtcantidad);
					txtcantidad.setBounds(134, 146, 65, 22);
				}
				{
					txtstock = new JTextField();
					Panelingrediente.add(txtstock);
					txtstock.setBounds(313, 146, 63, 22);
				}
				{
					btnregistrar = new JButton();
					Panelingrediente.add(btnregistrar);
					btnregistrar.setText("Registrar");
					btnregistrar.setBounds(82, 217, 147, 50);
					btnregistrar.setFont(new java.awt.Font("Bookman Uralic",2,12));
					btnregistrar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("imagen/cajareg.png")));
				}
				{
					btncancelar = new JButton();
					Panelingrediente.add(btncancelar);
					btncancelar.setText("Cancelar");
					btncancelar.setBounds(280, 218, 141, 49);
					btncancelar.setFont(new java.awt.Font("Bookman Uralic",2,12));
					btncancelar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("imagen/48px-Crystal_Clear_action_stop.png")));
				}
				{
					jSeparator1 = new JSeparator();
					Panelingrediente.add(jSeparator1);
					jSeparator1.setBounds(42, 44, 379, 2);
				}
				{
					jSeparator2 = new JSeparator();
					Panelingrediente.add(jSeparator2);
					jSeparator2.setBounds(42, 200, 379, 11);
				}
				{
					lbling = new JLabel();
					Panelingrediente.add(lbling);
					lbling.setText("Ingrediente");
					lbling.setBounds(169, 17, 120, 21);
					lbling.setFont(new java.awt.Font("Bookman Uralic",2,18));
				}
			}
			pack();
			this.setSize(471, 318);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	public void mensaje(String sms){
		JOptionPane.showMessageDialog(this,sms);
	}


	public void Limpiar() {
		txtcantidad.setText("");
		txtcoding.setText("");
		txtingrediente.setText("");
		txtstock.setText("");
		
	}
	public String getCantidad(){
		return txtcantidad.getText();
	}
	public String getCodigo(){
		return txtcoding.getText();
	}
	public String getNombre(){
		return txtingrediente.getText();
	}
	public String getStock(){
		return txtstock.getText();
	}
	public void addListener(ActionListener actionListener){
		btncancelar.addActionListener(actionListener);
		btnregistrar.addActionListener(actionListener);
	}
}
